VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Find 
   Caption         =   "Find"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   WindowState     =   2  'Maximized
   Begin VB.Frame Frame1 
      Height          =   7335
      Left            =   1080
      TabIndex        =   0
      Top             =   1680
      Width           =   17415
      Begin VB.CommandButton Command2 
         Caption         =   "Search Customer"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   11040
         TabIndex        =   5
         Top             =   600
         Width           =   1815
      End
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   5340
         TabIndex        =   3
         Top             =   600
         Width           =   3255
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Search Employee"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   9000
         TabIndex        =   2
         Top             =   600
         Width           =   1815
      End
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
         Height          =   5295
         Left            =   840
         TabIndex        =   1
         Top             =   1680
         Width           =   15855
         _ExtentX        =   27966
         _ExtentY        =   9340
         _Version        =   393216
         Rows            =   0
         FixedRows       =   0
         BackColorBkg    =   -2147483633
         WordWrap        =   -1  'True
         GridLines       =   2
         Appearance      =   0
      End
      Begin VB.Label Label1 
         Caption         =   "Enter the Text Here"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3240
         TabIndex        =   4
         Top             =   720
         Width           =   2295
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   3720
      Top             =   8400
      Width           =   3375
      _ExtentX        =   5953
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Image Image1 
      Height          =   840
      Left            =   7320
      Stretch         =   -1  'True
      Top             =   0
      Width           =   960
   End
   Begin VB.Label Label15 
      Caption         =   "JEEVAN VAISYA GREEN AGROTECH LLP"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   8400
      TabIndex        =   7
      Top             =   360
      Width           =   5895
   End
   Begin VB.Label Label16 
      Caption         =   "SEARCH OPTION FORM"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   10260
      TabIndex        =   6
      Top             =   840
      Width           =   2175
   End
End
Attribute VB_Name = "Find"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Connection
Dim rs As Recordset
Private Sub Command1_Click()
Dim i As Integer
MSFlexGrid1.Rows = 0
MSFlexGrid1.Cols = 0
If Text1 <> "" Then
Call database
If rs.RecordCount > 0 Then
MSFlexGrid1.Rows = rs.RecordCount + 1
MSFlexGrid1.Cols = rs.Fields.Count + 1
MSFlexGrid1.FixedRows = 1
MSFlexGrid1.FixedCols = 0
For i = 0 To rs.Fields.Count
MSFlexGrid1.FixedAlignment(i) = 3
Next
For j = 0 To rs.Fields.Count
MSFlexGrid1.ColAlignment(j) = 3
Next
MSFlexGrid1.ColWidth(0) = 600
MSFlexGrid1.ColWidth(1) = 2000
MSFlexGrid1.ColWidth(2) = 1500
MSFlexGrid1.ColWidth(3) = 1700
MSFlexGrid1.ColWidth(4) = 1700
MSFlexGrid1.ColWidth(5) = 1700
MSFlexGrid1.ColWidth(6) = 4000
MSFlexGrid1.ColWidth(7) = 2000
MSFlexGrid1.TextMatrix(0, 0) = "S.No."
MSFlexGrid1.TextMatrix(0, 1) = "Name"
MSFlexGrid1.TextMatrix(0, 2) = "Position"
MSFlexGrid1.TextMatrix(0, 3) = "Code No."
MSFlexGrid1.TextMatrix(0, 4) = "Intro No."
MSFlexGrid1.TextMatrix(0, 5) = "Unit"
MSFlexGrid1.TextMatrix(0, 6) = "Address"
MSFlexGrid1.TextMatrix(0, 7) = "Performance"
If Not rs.EOF Then
rs.MoveFirst
While Not rs.EOF
For i = 1 To rs.RecordCount
For j = 0 To rs.Fields.Count - 1
MSFlexGrid1.TextMatrix(i, 0) = i
MSFlexGrid1.TextMatrix(i, j + 1) = rs.Fields(j)
Next
rs.MoveNext
Next
Wend
End If
Else
MsgBox "Such Record Not Present"
End If
End If
End Sub
Private Sub Command2_Click()
Dim i As Integer
MSFlexGrid1.Rows = 0
MSFlexGrid1.Cols = 0
If Text1 <> "" Then
Call database1
If rs.RecordCount > 0 Then
MSFlexGrid1.Rows = rs.RecordCount + 1
MSFlexGrid1.Cols = rs.Fields.Count + 1
MSFlexGrid1.FixedRows = 1
MSFlexGrid1.FixedCols = 0
For i = 0 To rs.Fields.Count
MSFlexGrid1.FixedAlignment(i) = 3
Next
For j = 0 To rs.Fields.Count
MSFlexGrid1.ColAlignment(j) = 3
Next
MSFlexGrid1.ColWidth(0) = 600
MSFlexGrid1.ColWidth(1) = 1800
MSFlexGrid1.ColWidth(2) = 2000
MSFlexGrid1.ColWidth(3) = 1500
MSFlexGrid1.ColWidth(4) = 1500
MSFlexGrid1.ColWidth(5) = 1500
MSFlexGrid1.ColWidth(6) = 3500
MSFlexGrid1.ColWidth(7) = 1500
MSFlexGrid1.ColWidth(8) = 1500
MSFlexGrid1.ColWidth(8) = 2000
MSFlexGrid1.TextMatrix(0, 0) = "S.No."
MSFlexGrid1.TextMatrix(0, 1) = "Policy No"
MSFlexGrid1.TextMatrix(0, 2) = "Name"
MSFlexGrid1.TextMatrix(0, 3) = "Plan"
MSFlexGrid1.TextMatrix(0, 4) = "Nominee Name"
MSFlexGrid1.TextMatrix(0, 5) = "Nominee Relation"
MSFlexGrid1.TextMatrix(0, 6) = "Address"
MSFlexGrid1.TextMatrix(0, 7) = "Policy Term"
MSFlexGrid1.TextMatrix(0, 8) = "Installment"
MSFlexGrid1.TextMatrix(0, 9) = "Date of Commencement"
If Not rs.EOF Then
rs.MoveFirst
While Not rs.EOF
For i = 1 To rs.RecordCount
For j = 0 To rs.Fields.Count - 1
MSFlexGrid1.TextMatrix(i, 0) = i
MSFlexGrid1.TextMatrix(i, j + 1) = Switch(rs.Fields(j).Name = "JVM", rs.Fields(j).Name & rs.Fields(j), rs.Fields(j).Name = "DateCom", Format(rs.Fields(j), "dd/mm/yyyy"), 1, rs.Fields(j))
Next
rs.MoveNext
Next
Wend
End If
Else
MsgBox "Such Record Not Present"
End If
End If
End Sub
Private Sub Form_Load()
Adodc1.Visible = False
Set db = New Connection
db.Provider = "Microsoft.Jet.OLEDB.4.0"
db.Open App.Path & "\Jeevan.mdb"
End Sub
Private Sub database()
Set rs = New Recordset
rs.CursorLocation = adUseServer
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open "select name, pos, codeno, introno, unit, address, Perform from AgentInfo where name like '%" & Text1 & "%' or codeno like '%" & Text1 & "%'", db
End Sub
Private Sub database1()
Set rs = New Recordset
rs.CursorLocation = adUseServer
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open "select JVM, name, planno, nname, nrelation, address, term, Inst, datecom from customer where name like '%" & Text1 & "%' or jvm like '%" & Text1 & "%'", db
End Sub

